import easyocr
import cv2

# 1. 初始化阅读器（自动下载模型）
# reader = easyocr.Reader(['ch_sim', 'en'])
# 如果已经下载完了模型，可以直接指定模型位置
reader = easyocr.Reader(
    ['ch_sim', 'en'],
    model_storage_directory=r"./ocr_model",
    gpu=False,
    download_enabled=False  # 禁用在线下载
)

# 2. 读取图像并识别
img = cv2.imread("../images/test_wrap.png")
results = reader.readtext(img)
print(results) # list []

plate_text = "_".join([res[1]+"\n" for res in results])
print(plate_text)